package by.grsu.pochebut.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import com.epam.grsulab.webapi.entity.base.BaseEntity;

@Entity
public class Client extends BaseEntity{
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private Long id;
	
	@Column
	private String name;
	
	@Column
	private String passport;

	@OneToMany(targetEntity=Booking.class, mappedBy="client", cascade=CascadeType.ALL)
	private List<Booking> book;
	
	public List<Booking> getBook() {
		return book;
	}

	public void setBook(ArrayList<Booking> book) {
		this.book = book;
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassport() {
		return passport;
	}

	public void setPassport(String passport) {
		this.passport = passport;
	}

	@Override
	public String toString() {
	
		return this.name.toString();
	}
	
}

